package com.kfyang.manualgear.dao;

import com.kfyang.manualgear.annotation.Dao;
import com.kfyang.manualgear.annotation.crud.*;
import com.kfyang.manualgear.entity.PlainEntity;

@Dao
public interface FragDao {

    @Query(col = {"id", "name", "password", "image_url", "role"},
        value = "from plain where id = {id} [roleFrag]")
    @Frag(id = "roleFrag", value = "and role = {role}", cond = "role != null && !role.isEmpty()")
    @Construct("plainCt")
    PlainEntity selectFrag(int id, String role);
}
